UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'utDdIw+A1Rm5cHdsLKKPoUoU5e/EjkDZD2KDA3LTa08='
WHERE
key_id = 'b32237ba7dc3fb861f6fb34b856893e01f9820f5def8fa85e26bb0efa5637c8c'
AND (
token = 'utDdIw+A1Rm5cHdsLKKPoUoU5e/EjkDZD2KDA3LTa08='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)