UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GiU6U59SZhUUr+SOIiU1AecMK02VSVVz5Qjj/piLeOU='
WHERE
key_id = '6dc6fa196f22cfcdbfeb2dd07dd463598feec6b35c36bcddb04fbf41c33c3544'
AND (
token = 'GiU6U59SZhUUr+SOIiU1AecMK02VSVVz5Qjj/piLeOU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)