UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FEzfcM6IzVCmRQILz3wg7HDkvswQVz5ETJJBcS60AG4=' 
WHERE 
  key_id = 'da1c78125df9d50e3f27713347f2b4a7d5ea441a2d040a10d34892d50925c45f' 
  AND (
    token = 'FEzfcM6IzVCmRQILz3wg7HDkvswQVz5ETJJBcS60AG4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00269