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