UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'drCDKZHhkg73Bi7Ee/fYWZc8Rv/Wn4zW8jOkkUOwp0w='
WHERE
key_id = '1f8462dca4d563dec32d9e5fc03dca07f684fe7c63eba10eb8ed69b15be51e7e'
AND (
token = 'drCDKZHhkg73Bi7Ee/fYWZc8Rv/Wn4zW8jOkkUOwp0w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)