UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's9FB63Z2mNQ7jfQE/41w5+cmdFP5eIkzqZs6diCi/PA='
WHERE
key_id = '1dcaafceeb2734297f4c3917bb84e959b6250616e5a2adab3bede11aafcba2f6'
AND (
token = 's9FB63Z2mNQ7jfQE/41w5+cmdFP5eIkzqZs6diCi/PA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)