UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'A1agWfID5VJdEcUYoK6db5M6p1qNPu7LItW0KzU8lCo='
WHERE
key_id = '4e6e32d87b627c99aa09e2ab89caa50d90cdb6a00d7bcf6e5a153869cd773122'
AND (
token = 'A1agWfID5VJdEcUYoK6db5M6p1qNPu7LItW0KzU8lCo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)