UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eja/QPmK7mE4pgVCG97uJ3AUvKnLMEK6kxd/Odc9EVA=' 
WHERE 
  key_id = '775348e9cbfc691557aee540cdd7a8183eca88902362d50f8c692851e750ee37' 
  AND (
    token = 'eja/QPmK7mE4pgVCG97uJ3AUvKnLMEK6kxd/Odc9EVA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018