UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KNPhnZ5ykeAPpCkF2GtXBqCDB8npGgGwdQFLnNRmHyE=' 
WHERE 
  key_id = '2d2c7ed3c5048f8621f3ccf4a967b8f722288fa9e989fc7ab14b28d4c62300bc' 
  AND (
    token = 'KNPhnZ5ykeAPpCkF2GtXBqCDB8npGgGwdQFLnNRmHyE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029