UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z4gswXT8U4uGiL78tGUdDblciZbtcTzAtKftTxB9YSU='
WHERE
key_id = 'b6305c32dab32e16df5989be201d06dddfadd085c301ac98f272b41cca1aba50'
AND (
token = 'Z4gswXT8U4uGiL78tGUdDblciZbtcTzAtKftTxB9YSU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)