UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6K6saJoBNOzArJZW5xlmaYaZloFfkDBRObCJnxiP0Ys=' 
WHERE 
  key_id = 'a03a4939fd3db2f14476590343a9fa1d384ec73d1dcc49f87389e3c7ae417d22' 
  AND (
    token = '6K6saJoBNOzArJZW5xlmaYaZloFfkDBRObCJnxiP0Ys=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038