UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ykPGe2yGWgZchCj1hZLB9EJYPpKOi5syvAMLltQAQEw='
WHERE
key_id = '0b0e2f3c3921c237bb8ca8cc0d3584cff257ac08c5536da1b94e7f416e9c32d7'
AND (
token = 'ykPGe2yGWgZchCj1hZLB9EJYPpKOi5syvAMLltQAQEw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)