UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XC6oLS7eq1MLPsYRqZoaSiizYXsFuCNaAEr8pG/fHJg='
WHERE
key_id = '8891f54abea595193eb0d9a4d4924c6458c8bacee0a76ad20bbc75a4f3829e98'
AND (
token = 'XC6oLS7eq1MLPsYRqZoaSiizYXsFuCNaAEr8pG/fHJg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)