UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2ae/LUtFuWz0tK3HHZfv+xPysrfhX+qWINQTvx3aUAY='
WHERE
key_id = 'fb994bc05588a2667cd81945f461b5f06f9ea99319a86fc997f0ba841b7879bb'
AND (
token = '2ae/LUtFuWz0tK3HHZfv+xPysrfhX+qWINQTvx3aUAY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)