UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JzZCfI67kdSd2H/DFNLipOy2+X6Ywb7XXzkOjblwzwk=' 
WHERE 
  key_id = '4025bfb508d1675f8234a5c0aa5793fb21846abe89b101d32a3c8564e066eed7' 
  AND (
    token = 'JzZCfI67kdSd2H/DFNLipOy2+X6Ywb7XXzkOjblwzwk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021