UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E485RTqIWmRp6d/P0tzi+l6e6VGxuRGor4OSF+ZYKe4='
WHERE
key_id = '2f3c0de0fdbc45a079d78cf5fc0af8c11acb030f53632eafc83d7ecb8b6dd374'
AND (
token = 'E485RTqIWmRp6d/P0tzi+l6e6VGxuRGor4OSF+ZYKe4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)