UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vbJjlMSLqFXI79NYJ7pIA4ScT+catArfrYl+Qvl3AF8=' 
WHERE 
  key_id = '64b56f1cfb454cb7005fdd60ad0a26b059084300df1b259c4db21f570dbfde0e' 
  AND (
    token = 'vbJjlMSLqFXI79NYJ7pIA4ScT+catArfrYl+Qvl3AF8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023