UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5AD552DyRh/Sa7JaomrokNfXi3oICDD6tztvhm/t2kQ='
WHERE
key_id = 'b4cf5c829a89449c223cfb5721ded50bca876e6a3945cf7020046feec6d574b4'
AND (
token = '5AD552DyRh/Sa7JaomrokNfXi3oICDD6tztvhm/t2kQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)