UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jrCkSWKTdXxUuzpAslpu3RdtoKfr18suv0AHC2rwCk0=' 
WHERE 
  key_id = '8a714e1a31628bb49af2f4ee0e721700569ed3da4c5f2b6eba90728e2e4342d2' 
  AND (
    token = 'jrCkSWKTdXxUuzpAslpu3RdtoKfr18suv0AHC2rwCk0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00081