UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6dxOc94oMO8DT5Yyqpjdo+VgOdE76xQDpxBnILyRU9Y=' 
WHERE 
  key_id = '93bc10b509fc7cbcdfb806516e1b8fb08b4fda25aed6132be32ef46d913ab0f9' 
  AND (
    token = '6dxOc94oMO8DT5Yyqpjdo+VgOdE76xQDpxBnILyRU9Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022