UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TXjFUASwbRcQ0LP0iWMfl+dXpvOAaFpZlMYmcMNQW04='
WHERE
key_id = '3505b4f8fdb294eb52b3bd10c09ccd702d6d24ff6c0338e5d61201abdd657a0d'
AND (
token = 'TXjFUASwbRcQ0LP0iWMfl+dXpvOAaFpZlMYmcMNQW04='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)