UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YtPqlUS+mDZXyBJwDIveZkTFOYW5j0YhJ2RK3sSwCYE='
WHERE
key_id = 'ebf39d6446293eace7bcb475cddfd00ef53c2e1a086c571e9ac6a588912b1c61'
AND (
token = 'YtPqlUS+mDZXyBJwDIveZkTFOYW5j0YhJ2RK3sSwCYE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)