UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nZ1yf/PkcnEdVGacLL3/2W8XzjCMD54Hf0jBrDb+H9g=' 
WHERE 
  key_id = 'd55996b71fd04f8f627497fb3302ef29e183a37e74fda5bd2b67ab1c18564d85' 
  AND (
    token = 'nZ1yf/PkcnEdVGacLL3/2W8XzjCMD54Hf0jBrDb+H9g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034