UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mMHDbmXLAmTepjd3E3lHsKENyMOGZ6RkhCHmIrpoRT8='
WHERE
key_id = '83e1e93417fec5f5dd74d7888920b1b8e71e35d9277a0e7bba97d87dccfef139'
AND (
token = 'mMHDbmXLAmTepjd3E3lHsKENyMOGZ6RkhCHmIrpoRT8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)