UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ATEimr+CfUQVLUKt2MsdayXtujcLu4D+Q2xye7hMPyg='
WHERE
key_id = 'cd84824978ef276b168c77ae89c20b6e5d6f8526472e4017e48600cca8506f4c'
AND (
token = 'ATEimr+CfUQVLUKt2MsdayXtujcLu4D+Q2xye7hMPyg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)