UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xsl2aZNqYA6svAw3rAzGBVJh66PvViCq5QytdE8jgDk='
WHERE
key_id = '866fbd608c21ad5df4689abbe49ecac430c8db75e6473114c2fd23259d7a771a'
AND (
token = 'xsl2aZNqYA6svAw3rAzGBVJh66PvViCq5QytdE8jgDk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)