UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VG7IsYM7EcIVqh/kzfSIwr06SS9bD7vJ41K/rKwxu14='
WHERE
key_id = 'fcbb94e28f7f06ebfac267b083b2669863c2c3b7382ec0a21af7f63feefac936'
AND (
token = 'VG7IsYM7EcIVqh/kzfSIwr06SS9bD7vJ41K/rKwxu14='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)