UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yFqjR/7y7bjRIbc1BD+3TqbmkRxzlmic0oDVGlFvels=' 
WHERE 
  key_id = 'ad325f9ed44753af93a2ec065e55ff595c189d5673c2a8ff4c031e9a01bae3b4' 
  AND (
    token = 'yFqjR/7y7bjRIbc1BD+3TqbmkRxzlmic0oDVGlFvels=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021