UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V/BeCsksjWMg/MUiJ6kOvE/VjXN2LtmC16Rwq77Q5uM='
WHERE
key_id = '830527e96257912552645a09dde3ff9d39a160f771081eb0c4ab7808587958a4'
AND (
token = 'V/BeCsksjWMg/MUiJ6kOvE/VjXN2LtmC16Rwq77Q5uM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)