UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ISDnQecyK8oA3MiPRTJ1dNl6UFJNmE60Q912cxnX1hM='
WHERE
key_id = '06a05d44a8e63c859f6888fbde2ad5ba39e96235d4bf477dcf51341a0e61b130'
AND (
token = 'ISDnQecyK8oA3MiPRTJ1dNl6UFJNmE60Q912cxnX1hM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)