UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0pZB/9GBHMov9YietCJUSfXncUf34TY47NaiOxicLzM='
WHERE
key_id = 'c377eca3c3c6aae77771af16d829bf8d43fb28f9efd7567edefdd98a9abcd2be'
AND (
token = '0pZB/9GBHMov9YietCJUSfXncUf34TY47NaiOxicLzM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)