UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TGXUXRWgcQzUolrSZHjdXf8yRh/OVVk/ZBj18PpTK1Q='
WHERE
key_id = '95314875ee0b5df1f89ea3aa2e2efb48562fa1b956fbaccd0dab4bfc5c30a48d'
AND (
token = 'TGXUXRWgcQzUolrSZHjdXf8yRh/OVVk/ZBj18PpTK1Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)