UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FgAkpE08y/YzF8rLdNm8wY3H9fhUaq6h41tohcTHUfo='
WHERE
key_id = '3f08efe97c4b9bd06fcab2737ec08e977e895ed79a7c4f28d8ba748585f8fed8'
AND (
token = 'FgAkpE08y/YzF8rLdNm8wY3H9fhUaq6h41tohcTHUfo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)