UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4/0HKBcVWD5NxPVMl2BXSjtRDUSqJ8Jhr2DE66HwT98='
WHERE
key_id = 'bf95bbd69abb4d3d2f8b4a061f0224a72219c17a6ccdbfea16ac77210c9601d5'
AND (
token = '4/0HKBcVWD5NxPVMl2BXSjtRDUSqJ8Jhr2DE66HwT98='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)