UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2I6ntOQc+fECS8lUggVpJOYzCxvMmHQbhT/34PRNFsQ='
WHERE
key_id = 'e2798d450cfc04b212e60c8211066ec0a0c36bb6d3739446380a2fb3269f31ff'
AND (
token = '2I6ntOQc+fECS8lUggVpJOYzCxvMmHQbhT/34PRNFsQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)