UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7KGk93Sbwx/J8OAO4d6uJat9Pa6uUHNJlsLYv9klgBY='
WHERE
key_id = '0fcf3b5418c6b54801f35abdde801f902e1356777d3cb6091f65c5ddf468226a'
AND (
token = '7KGk93Sbwx/J8OAO4d6uJat9Pa6uUHNJlsLYv9klgBY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)