UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0mmkenrcSOp1sQilalLD3FBdjBEO6Lf/+Jdi8FM8AsE=' 
WHERE 
  key_id = 'a751d26d5f62665b84e3f8350050691e65a2270867df9af0d21f21165d07be53' 
  AND (
    token = '0mmkenrcSOp1sQilalLD3FBdjBEO6Lf/+Jdi8FM8AsE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019