UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LrIhdgWIHjXGkeNgUkHtSVN8ECNAxBZNwpHGZcxmSMw='
WHERE
key_id = 'af8742a865924cbc84873bf030ee9280b23a5c3eebf3ca61421c9de715f848eb'
AND (
token = 'LrIhdgWIHjXGkeNgUkHtSVN8ECNAxBZNwpHGZcxmSMw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)